  let divTyping = document.getElementById('text')
  let i = 0,
    timer = 0,
    str = '山不在高，有仙则名，水不在深，有龙则灵'

  function typing () {
    if (i <= str.length) {
      divTyping.innerHTML = str.slice(0, i++)
      timer = setTimeout('typing()', 200)
    }
    else {
      divTyping.innerHTML = str//结束打字,移除 _ 光标
      clearTimeout(timer)
    }
  }
  typing()